<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<meta name="keywords" content="在线字帖,钢笔字帖,毛笔字帖" />
<meta name="description" content=""/>
<title>学而练字网</title>
<script type="text/javascript" src="js/loadfont.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hanzi-writer@3.0/dist/hanzi-writer.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css" />
<link rel="stylesheet" type="text/css" href="css/shufa.css" />
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?6603cfa137571475df2371da32897626";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body onload='selectText("area")'>

<div style='text-align:center'>
<h1 class='title'>学而练字网</h1>
<a href='book/dawu.html'>大巫传</a> | 
<a href='book/cnhstry.html'>中国通史</a>
</div>

<div contenteditable="true" id='area' oninput='input()'>
从前有座山，山里有座庙，庙里有个老和尚。他说，
从前有座山，山里有座庙，庙里有个老和尚。他说，
……
</div>
<p style='text-align:center;color:gray;font-size:80%'>建议使用谷歌浏览器访问</p>
<div class='opr'>
<button id='btn_display' onclick='change_grid()'>平行线</button>
<button id='btn_font' onclick='btn_fmly()'>庞中华钢笔字体</button>
</div>

<div style='text-align:center'>
<div id='model' class="modal">
  <div class="modal-background"></div>
  <div class="modal-content">
	<button class="button is-primary is-medium" onclick='zidian()'>查字典</button><span id='chazi' style="display:none"></span>
	<div id="character-target-div"></div>
	<img src='img/close.jpg' width=80 alt='close' style='cursor:hand' onclick='model(false)'/>
  </div>  
</div>
</div>

<div id='shu' class='mi'></div>

<p style='text-align:center;margin:30px;font-size:80%'>© 2021 学而网 | <a href='html/mianze.html'>免责声明</a> | <a href='html/shoulu.html'>申请收录</a> | 邮件：<a href='mailto:bluce.hu@qq.com'>bluce.hu@qq.com</a> | 粤ICP备19123632号</p>
<!-- <p style='color:red'>声明：本站字体来源于网络，仅用于个人学习，商业使用请自行联系版权方购买商业授权！</p> -->

<script>
var fmly_font = 'zhi_mini';
setFont(fmly_font)
function btn_fmly(){
	$('btn_font').innerHTML = fmly_font.startsWith('pang')?'庞中华钢笔字体':'我欲与君相知字体'
	fmly_font = fmly_font.startsWith('pang')?'zhi':'pang'
	if(!edited) fmly_font = fmly_font+'_mini'
	setFont(fmly_font)
}

var edited = false
function input(){
	edited = true
	if(fmly_font.endsWith('_mini')) 
		fmly_font = fmly_font.substr(0, fmly_font.length-5)
	setFont(fmly_font)
	setCookie("TEXT", $('area').innerText, 5)
}

var b_disp = true;
function change_grid(){	
	$('shu').className = b_disp?'line':'mi'
	$('btn_display').innerHTML = b_disp?'米字格':'平行线'
	b_disp = !b_disp
}
</script>
<script type="text/javascript" src="js/util.js"></script>
<script>
let text = getCookie("TEXT")
if( text!="" ){	
	$('area').innerText = text
	input()
}

var writer = HanziWriter.create('character-target-div', '永', {
	width: 300,
	height: 300,
	padding: 5,
	delayBetweenLoops: 1000,
	showOutline: true
});
function model(b){
	if(b)
		$('model').classList.add('is-active')
	else
		$('model').classList.remove('is-active')
}
function zidian(){
	window.open('https://wyw.hwxnet.com/search.do?wd=' + $('chazi').innerHTML)
}
</script>
</body>
</html>